How can I stop the prefix of "Copy of " from being added to the file name when I save an Excel file that was mailed as an attachment?
It is very annoying to have to keep deleting that unwanted addition to my filenames.
Technology Tips and News
How can I stop the prefix of "Copy of " from being added to the file name when I save an Excel file that was mailed as an attachment?
It is very annoying to have to keep deleting that unwanted addition to my filenames.
1) Don't open attachments - save them first and then open them.
2) You can use this code in the ThisWorkbook object of your Personal.xls:
Private WithEvents App As Application
Private Sub App_WorkbookBeforeSave(ByVal Wb As Workbook, ByVal SaveAsUI As Boolean, Cancel As Boolean)
If InStr(1, Wb.Name, "Copy of ") = 1 Then
Application.EnableEvents = False
Cancel = True
Wb.SaveAs Replace(Wb.FullName, "Copy of ", "")
Application.EnableEvents = True
End If
End Sub
Private Sub Workbook_Open()
Set App = Application
End Sub
Thanks, Bernie. I was almost hoping someone would tell me I was an idiot for not finding the obvious setting in Options to turn off this "helpful" feature. I'm a little annoyed with Microsoft for tampering with my filenames.
I'll give your App_WorkbookBeforeSave code a try.
Dory O.
Actually, Dory0, there is a way to turn this off simply.
Open Outlook 2010
Click on File
Click on Options
Click on Trust Center
Click on Trust Center Settings button
Click on Attachment Handling
Click on Turn Off Attachment Preview
This will also turn off that annoying preview function that kicks in every time you single-click on an attachment name.
Actually, Dory0, there is a way to turn this off simply.
Open Outlook 2010
Click on File
Click on Options
Click on Trust Center
Click on Trust Center Settings button
Click on Attachment Handling
Click on Turn Off Attachment Preview
This will also turn off that annoying preview function that kicks in every time you single-click on an attachment name.
I noticed that this did stop the preview function, but if I open the file from the email and then attempt to save it, the notorious "Copy of" prefix still inserted itself...